package main
import "fmt"

func main(){
	var  a [5]int
	fmt.Println("a:",a)

	a[1] = 1
	fmt.Println("a:",a)
	fmt.Println("a[1]:",a[1])

	fmt.Println("length of a:",len(a))

	b := [5]int{1,2,3,4,5}
	fmt.Println("b:",b)

	// b已经指定长度，不能再改
	// b = [...]int{1,2,3,4}

	c := [...]int{1,3,4} 
	fmt.Println("length of c:",len(c))

	b = [...]int{1,3:0,666}
	fmt.Println("b:",b)

	var ma [2][3]int
	for i:=0;i<2;i++{
		for j:=0;j<3;j++{
			ma[i][j] = i+j
		}
	}
	fmt.Println("ma:",ma)

	// 语言规范：复合字面量每一行要有逗号
	// ma = [2][3]int{
	// 	{1,2,3},
	// 	{4,5,6}
	// }
	ma = [2][3]int{
		{1,2,3},
		{4,5,6},
	}
	fmt.Println("ma:",ma)
}